package com.example.ui;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ApiController {

    @Autowired
    private UserHystrixService userHystrixService;


    @RequestMapping("/api/feign/user")
    public Object feignUser(Integer age) {
        return userHystrixService.feignUser(age == null ? 0 : age);
    }

    @RequestMapping("/api/ribbon/user")
    public Object ribbonUser(Integer age) {
        return userHystrixService.ribbonUser(age == null ? 0 : age);
    }
}
